package com.farm.decorator;

import com.farm.AgriculturalMachine;

//自动驾驶装饰器
public class AutoPilotDecorator extends MachineDecorator {
    public AutoPilotDecorator(AgriculturalMachine decoratedMachine) {
        super(decoratedMachine);
    }

    @Override
    public void operate(String  machineName) {
        super.operate(machineName);
        enableAutoPilot(machineName);
    }

    @Override
    public void displayStatus(String  machineName) {

    }

    @Override
    public String getDescription() {
        return super.getDescription() + ", 带自动驾驶";
    }

    private void enableAutoPilot(String machineName) {
        System.out.println(machineName + "启用自动驾驶模式");
    }
}
